<%@page import="com.meila.cms.util.config.Property"%>
<%@page import="com.meila.cms.entity.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"  %> 
<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%
 	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 
    User user=((User) session.getAttribute("loginUser"));

%>

<!DOCTYPE HTML>
<html lang="zh-CN">
  <head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>整车设计</title>
	
  </head>
  
  <body class="client-body" id="loading">
 
  	<jsp:include page="../common/client-head.jsp"></jsp:include>
    <script src="resources/js/system/carDesign/designCar.js"></script>

  	<div class="client-content">
  		<jsp:include page="../common/client-leftMenu.jsp"></jsp:include>
  	
  		<div class="client-contentBox">
	  		<div class="cd-head">
	  			<a class="btn btn-default" href="front/carDesign/newDesign">新建设计<i class="fa fa-plus"></i></a>
 
	  			<div class="cd-volume">
		  			<div class="progress">
					  <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: <%=user==null? "":(user.getRemianSpace()/8)+"%" %>;">
					    <span class="sr-only">30% Complete</span>
					  </div>
					</div>
					<div class="cd-volumeCount"><span>私有容量</span><%=user==null? "":(user.getRemianSpace()/8)+"%" %></div>
				</div>
  			</div>
  			
  			<div class="cd-carList">
  			    			
	  			<c:forEach items="${datas.datas}" var="carDesign">
		  				<div class="cd-listBar clearfix">
		  					<div class="cd-listLeft">
		  						<div class="cd-listImg">
		  						    <c:if test="${carDesign.carsidepic!=null}">
		  						        <img src="<%=Property.getProperty("FILESERVER_PATH") %>?id=${carDesign.carsidepic}&timestr=<%=new Date().getTime() %>"/>
		  						     </c:if>
		  						     <c:if test="${carDesign.carsidepic==null}">
		  						        <img src="resources/images/part3.png"/>
		  						     </c:if>
		  						 </div>
		  					</div>
		  					<div class="cd-listRight">
		  						<div class="cd-listTitle"><span>${carDesign.designname}</span><span><fmt:formatDate pattern="yyyy-MM-dd" value="${carDesign.createtime}" /></span></div>
		  						<div class="cd-listTitle2"><span>最后修改时间：<fmt:formatDate  pattern="yyyy-MM-dd HH:mm:ss"  value="${carDesign.updatetime}" /></span></div>
		  						<div class="cd-listBtns btnBox clearfix">
		  							<a class="a-black activeBtn" href="javascript:carDesignListToURL(1,${carDesign.id})">修改设计</a>
		  							<a class="a-black" href="javascript:carDesignListToURL(2,${carDesign.id},'${carDesign.carid}')">零件清单</a>
		  							<a class="a-black" href="javascript:carDesignListToURL(3,${carDesign.id},'${carDesign.carid}')">工艺指令</a>
		  							<a class="a-black" href="javascript:download(${carDesign.id},'${carDesign.carid}')">下载</a>
		  						</div>
		  						<a class="cd-barDel" href="javascript:delCarDesign('${carDesign.id}');"><i class="fa fa-times-circle-o"></i></a>
		  					</div>
		  				</div>
  				</c:forEach>
  			    <nav class="clearfix">
				
					<c:if test="${datas.total > 0}">
						<jsp:include page="/jsp/pager.jsp">
							<jsp:param value="${datas.total}" name="totalRecord"/>
							<jsp:param value="front/carDesign/carDesign_list" name="url"/>
						</jsp:include>
					</c:if>

				</nav>
  			</div><!-- cd-carList -->
  		</div>
  	</div>

    	<!-- Modal -->
	<div class="modal fade bs-example-modal-sm" id="loadModal" tabindex="-1" role="dialog" aria-labelledby="loadModalLabel" data-backdrop="static">
	  <div class="modal-dialog modal-sm" role="document">
	    <form action="front/carDesign/downloadFileBychose" method="post" id="downloadForm">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		        <h4 class="modal-title">请选择所需文档</h4>
		      </div>
		      
		      <div class="modal-body load-modalBody clearfix">
		        <input name="designid"  id="designid" type="hidden"/> 
		        <label><input name="chose" type="checkbox" value="1" /> 2D文档 </label>
				<label><input name="chose" type="checkbox" value="2" /> 3D文档 </label>
				<label><input name="chose" type="checkbox" value="3" /> 零件清单 </label>
				<label><input name="chose" type="checkbox" value="4" /> 工艺指令 </label>
		      </div>
		      
		      <div class="modal-footer">
		      	<button type="button" class="btn btn1" onclick="submitDownload()">确定下载</button>
		        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
		      </div>
		    </div>
	     </form>
	  </div>
	</div>
  </body>
</html>
